package com.apes.autoparts.supplier.dataCenter;

import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.Model;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;

/**
 * Created by lishikun on 2021/5/19 14:15
 */
@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = DCBusinessinfoContrast.CONST_TABLE_NAME)
public class DCBusinessinfoContrast extends Model {
    public static final String CONST_TABLE_NAME = "dc_businessinfo_contrast";

    @Id
    @Comment("流水码")
    @Column(name = "id", length = 32)
    @ApesGenerator(code = CONST_TABLE_NAME, name = "数据中心供应商对照表")
    private String id;

    @OneToOne(optional = false)
    @JoinColumn(name = "dc_businessinfo_id", referencedColumnName = "ID")
    @Comment("待办")
    private DCBusinessinfo DCBusinessinfo;

    @Comment("对照商家编码")
    @Column(name = "CONTRAST_BUSINESS_ID")
    private String CONTRAST_BUSINESS_ID;

    @Comment("对照品牌名称")
    @Column(name = "CONTRAST_BRAND_NAME")
    private String CONTRAST_BRAND_NAME;

    @Comment("对照产地")
    @Column(name = "CONTRAST_ORIGIN")
    private String CONTRAST_ORIGIN;

    @Comment("对照零件编码")
    @Column(name = "CONTRAST_PART_ID")
    private String CONTRAST_PART_ID;

    @Comment("商家配件库存价格信息编码")
    @Column(name = "BUSINESSINFO_ID")
    private String BUSINESSINFO_ID;

    @Comment("对照品牌编码")
    @Column(name = "CONTRAST_BRAND_ID")
    private String CONTRAST_BRAND_ID;

    @Comment("供应商编码")
    @Column(name = "SUPPLIER_ID")
    private String SUPPLIER_ID;

    @Comment("供应商名称")
    @Column(name = "SUPPLIER_NAME")
    private String SUPPLIER_NAME;

    @Comment("供应商名称")
    @Column(name = "BZHL")
    private String BZHL;

    @Comment("配件名称编码")
    @Column(name = "CATEGORY_ID")
    private String CATEGORY_ID;
}
